package com.tools.web.interceptor.auth;


import com.tools.common.container.OwnPairs;
import com.tools.common.object.C;
import com.tools.common.object.Note;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 用户认证信息的对象的接口规范
 * */
@Note("用户认证信息的对象的接口规范")
public interface AuthUser {

    String getUuid();

    void setUuid(String uuid);

    Object getUserId();

    String stringUserId();

    long longUserId();

    int intUserId();

    void setUserId(Object userId);

    void setUserId(String userId);

    void setUserId(long userId);

    void setUserId(int userId);

    String getLoginDeviceType();

    void setLoginDeviceType(String loginDeviceType);

    void setLoginDeviceType(LoginDeviceType loginDeviceType);

    String getLoginUserType();

    void setLoginUserType(String loginUserType);

    Object getUser();

    <T> T getUser(Class<T> userType);

    <T> T getUser(C<T> userType);

    void setUser(Object user);

    Class<?> getUserTypeClass();

    void setUserTypeClass(String userTypeClassName);

    void setUserTypeClass(Class<?> userTypeClass);

    Map<String, ?> getRoleKeyMap();

    <R> Map<String, R> getRoleKeyMap(Class<R> valueType);

    Set<String> roleKeySet();

    Collection<?> roleValueCollection();

    <R> Collection<R> roleValueCollection(Class<R> valueType);

    <R> Collection<R> roleValueCollection(C<R> valueType);

    Map<String, ?> cloneRoleKeyMap();

    <R> Map<String, R> cloneRoleKeyMap(Class<R> valueType);

    <R> Map<String, R> cloneRoleKeyMap(C<R> valueType);

    void setRoleKeyMap(Map roleKeyMap);

    void setRoleKeyMap(OwnPairs roleKeyPairs);

    Map<String , ?> getPermKeyMap();

    <P> Map<String, P> getPermKeyMap(Class<P> valueType);

    Set<String> permKeySet();

    Collection<?> permValueCollection();

    <P> Collection<P> permValueCollection(Class<P> valueType);

    <P> Collection<P> permValueCollection(C<P> valueType);

    Map<String, ?> clonePermKeyMap();

    <P> Map<String, P> clonePermKeyMap(Class<P> valueType);

    <P> Map<String, P> clonePermKeyMap(C<P> valueType);

    void setPermKeyMap(Map permKeyMap);

    void setPermKeyMap(OwnPairs permKeyPairs);

    List<?> getRouterList();

    <R> List<R> getRouterList(Class<R> routerType);

    List<?> cloneRouterList();

    <R> List<R> cloneRouterList(Class<R> routerType);

    <R> List<R> cloneRouterList(C<R> routerType);

    void setRouterList(Iterable routerList);

    Map<String, Object> cloneCustomData();

    <T> T customDataAsJavaBean(C<T> javaBeanType);

    Map<String, Object> getCustomData();

    void setCustomData(Map<String, Object> customData);

    void setCustomData(OwnPairs<String, Object> customData);

    void setCustomData(Object javaBean);

    void setCustomData(String jsonObject);

    void copyAuthData(AuthUser targetAuthUser);

    void copyCustomData(AuthUser targetAuthUser);

    AuthUser uuid(String uuid);

    AuthUser userId(Object userId);

    AuthUser userId(String userId);

    AuthUser userId(long userId);

    AuthUser userId(int userId);

    AuthUser loginDeviceType(String loginDeviceType);

    AuthUser loginDeviceType(LoginDeviceType loginDeviceType);

    AuthUser loginUserType(String loginUserType);

    AuthUser user(Object user);

    AuthUser userTypeClass(String userTypeClassName);

    AuthUser userTypeClass(Class<?> userTypeClass);

    AuthUser roleKeyMap(Map roleKeyMap);

    AuthUser roleKeyMap(OwnPairs roleKeyPairs);

    AuthUser permKeyMap(Map permKeyMap);

    AuthUser permKeyMap(OwnPairs permKeyPairs);

    AuthUser routerList(Iterable routerList);

    AuthUser customData(Map<String, Object> customData);

    AuthUser customData(OwnPairs<String, Object> customData);

    AuthUser customData(Object javaBean);

    AuthUser customData(String jsonObject);

    boolean hasRole(String roleKey);

    boolean hasAllRole(String... roleKeys);

    boolean hasAllRole(Iterable<String> roleKeys);

    boolean hasAnyRole(String... roleKeys);

    boolean hasAnyRole(Iterable<String> roleKeys);

    boolean hasPerm(String permKey);

    boolean hasAllPerm(String... permKeys);

    boolean hasAllPerm(Iterable<String> permKeys);

    boolean hasAnyPerm(String... permKeys);

    boolean hasAnyPerm(Iterable<String> permKeys);

    AuthUser putData(String name, Object value);

    AuthUser putAllData(Map customData);

    AuthUser putAllData(OwnPairs customData);

    AuthUser putAllData(Object javaBean);

    AuthUser putAllData(String jsonObject);

    AuthUser removeData(String name);

    AuthUser removeAllData(String... names);

    AuthUser removeAllData(Iterable<String> names);

    AuthUser clearData();

    boolean containsData(String name);

    boolean containsAllData(String... names);

    boolean containsAllData(Iterable<String> names);

    boolean containsAnyData(String... names);

    boolean containsAnyData(Iterable<String> names);

    int dataSize();

    Object dataGet(String name);

    <V> V dataGet(String name, Class<V> valueType);

    <V> V dataGet(String name, C<V> valueType);
}
